import { reactive, ref } from 'vue';
import { SceneParamItem } from '/@/api/maintenance-center/microservice-govern/scene/model/sceneModel';

export const sceneColumns = ref([
  {
    title: '业务场景',
    dataIndex: 'scenarioName',
    key: 'scenarioName',
    resizable: true,
    width: 150,
  },
  {
    title: '业务Id',
    dataIndex: 'id',
    key: 'id',
    resizable: true,
    width: 200,
  },
  {
    title: '所属应用',
    dataIndex: 'appName',
    key: 'appName',
    resizable: true,
    width: 100,
  },
  {
    title: '所属企业',
    dataIndex: 'tenantName',
    key: 'tenantName',
    resizable: true,
    width: 100,
  },
  {
    title: '操作',
    dataIndex: 'action',
    key: 'action',
    resizable: true,
    width: 100,
  },
]);

export const detailsHeaderColumns = [
  {
    key: 'headerKey',
    title: 'header Key',
    dataIndex: 'headerKey',
    width: '30%',
  },
  {
    key: 'alignmentMode',
    title: '匹配方式',
    dataIndex: 'alignmentMode',
  },
  {
    key: 'headersRule',
    title: 'Headers规则',
    dataIndex: 'headersRule',
  },
];

export const form = reactive({
  scenarioName: '',
  appId: '',
  tenantCode: '',
  requestMethod: '',
  apiPath: '',
  description: '',
  id: '',
  appName: '',
  tenantName: '',
  headers: ref<SceneParamItem[]>([]),
});

export const headerColumns = [
  {
    key: 'headerKey',
    title: 'header Key',
    dataIndex: 'headerKey',
    width: '30%',
  },
  {
    key: 'headerMatch',
    title: '匹配方式',
    dataIndex: 'headerMatch',
  },
  {
    key: 'headerValue',
    title: 'header值',
    dataIndex: 'headerValue',
  },
  {
    key: 'operation',
    title: '操作',
    dataIndex: 'operation',
  },
];
